<template>
	<view>
		<!-- <view class="top" @click="Goto">
			<view class="top-main">
				<image src="https://yhflsyz.oss-cn-guangzhou.aliyuncs.com/Store/Group%203946%402x.png" mode="" class="img"></image>
				<view class="sp">
					<view class="title">
						支付宝<text style="font-size: 24rpx;color: #A6A6A8;margin-left: 10rpx;">{{data.alipay_name?data.alipay_name:''}}</text>
					</view>
					<view class="num">
						{{data.alipay_code?data.alipay_code:'未配置'}}
					</view>
				</view>
			</view>
		</view> -->
		
		<view class="top">
			<view class="top-main">
				<image src="https://yhflsyz.oss-cn-guangzhou.aliyuncs.com/Store/Group%203948%402x.png" mode="" class="img"></image>
				<view class="sp">
					<view class="title">
						微信
					</view>
					<view class="num num1">
						已授权
					</view>
				</view>
			</view>
		</view>
		
		<view class="top" @click="Gotocard(1)">
			<view class="top-main">
				<image src="https://yhflsyz.oss-cn-guangzhou.aliyuncs.com/Store/image%201413%402x.png" mode="" class="img"></image>
				<view class="sp">
					<view class="title">
						{{data.bank_name?data.bank_name:'未配置'}}
					</view>
					<view class="num num2">
						{{data.bank_code?data.bank_code:'未配置'}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				index:1,
				bank_code:'',
				bank_name:'',
				bank_user:'',
				data:''
				
			}
		},
		onLoad() {
			this.$u.api.shop.Getpayset().then(res=>{
				if(res.code == 200){
					this.data = res.data
				}
			})
		},
		onShow() {
			this.$u.api.shop.Getpayset().then(res=>{
				if(res.code == 200){
					this.data = res.data
				}
			})	
		},
		methods:{
			getValue(list){
				this.bank_code = list.bank_code
				this.bank_name = list.bank_name
				this.bank_user = list.bank_user
				let obj = {
					bank_code:list.bank_code,
					bank_name:list.bank_name,
					bank_user:list.bank_user
				}
				this.$u.api.shop.Chagecard(obj).then(res =>{
					console.log(res,'我是aa');
					if(res.code == 200){
						uni.showToast({
							title: '提交成功！',
							icon: 'error',
							duration: 2000
						})
						setTimeout(()=>{
							uni.navigateBack({
							        delta: 1,
							})
						},2000)
					}else{
						uni.showToast({
							title: req.msg,
							icon: 'error',
							duration: 2000
						})
					}
				}).catch(req =>{
					console.log(req,'ads');
					uni.showToast({
						title: req.data.msg,
						icon: 'error',
						duration: 2000
					})
				})
			},
			Gotocard(index){
				uni.navigateTo({
					url:`../my/changecard?id=${index}`
				})
			},
			Goto(){
				uni.navigateTo({
					url:'./ZFB'
				})
			}
		}
	}
</script>

<style>
	.top{
		width: 690rpx;
		height: 158rpx;
		background-color: white;
		border-radius: 16rpx;
		margin-left: 30rpx;
	}
	.top-main{
		width: 660rpx;
		height: 158rpx;
		margin-left: 30rpx;
		margin-top: 26rpx;
		display: flex;
		align-items: center;
	}
	.num{
		font-size: 32rpx;
		color:black;
	}
	.title{
		font-size: 32rpx;
		color: black;
		width: 520rpx;
	}
	.num1{
		font-size: 24rpx;
		color:#A6A6A8;
	}
	.num2{
		font-size: 28rpx;
	}
	.sp{
		width: 520rpx;
		height: 100rpx;
		margin-left: 40rpx;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
	}
	.img{
		width: 100rpx;
		height: 100rpx;
	}
</style>